package com.skyworth.web.wechat.protocol;

import com.skyworth.web.wechat.common.WxConstant;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by yuhaichao on 2016/9/21.
 */
public class NotifyMsg {


    public static Map<Object,Object> orderWaitMsg(String openid,String orderId,String datetime){
        Map<Object,Object> map = new HashMap<Object, Object>();
        map.put("touser", openid);
        map.put("template_id", "KJG4_x_t2jhKs78CBtM5Np1rR8bMnKZN6yH7WLKTUXU");
        String ddUrl= WxConstant.WX_DOMAIN+"wechat/index.html?from=orders#action=orders";
        map.put("url", ddUrl);
        map.put("topcolor", "#FFFFFF");

        Map<Object,Object> d = new HashMap<Object, Object>();
        Map<Object,Object> dataMap = new HashMap<Object, Object>();
        dataMap.put("value", "您好！ 您已成功下单，正在等待服务员审核");
        dataMap.put("color", "#173177");
        d.put("first", dataMap);

        Map<Object,Object> dataMap1 = new HashMap<Object, Object>();
        dataMap1.put("value", orderId);
        dataMap1.put("color", "#173177");
        d.put("keyword1", dataMap1);

        Map<Object,Object> dataMap2 = new HashMap<Object, Object>();
        dataMap2.put("value", datetime);
        dataMap2.put("color", "#173177");
        d.put("keyword2", dataMap2);

        Map<Object,Object> dataMap3 = new HashMap<Object, Object>();
        dataMap3.put("value", "如有疑问，请联系服务员");
        dataMap3.put("color", "#173177");
        d.put("remark", dataMap3);


        map.put("data", d);
        return map;
    }

    public static Map<Object,Object> orderHandleMsg(String openid,String orderId){
        Map<Object,Object> map = new HashMap<Object, Object>();
        map.put("touser", openid);
        //map.put("template_id", "tAl95Jsy0Z595J3wmLzT-_AmsqaLYrWuBPUnQ6vSIcc");
        map.put("template_id", "_5XJuU9AVsbdnQ0dX9vBRiT7lkAPZuLDDVLZOYK6bCk");
        String ddUrl= WxConstant.WX_DOMAIN+"wechat/index.html?from=orders#action=orders";
        map.put("url", ddUrl);
        map.put("topcolor", "#FFFFFF");

        Map<Object,Object> d = new HashMap<Object, Object>();
        Map<Object,Object> dataMap = new HashMap<Object, Object>();
        dataMap.put("value", "您好！ 您的订单已被受理，感谢您的支持");
        dataMap.put("color", "#173177");
        d.put("first", dataMap);

        Map<Object,Object> dataMap1 = new HashMap<Object, Object>();
        dataMap1.put("value", "智慧餐饮点餐");
        dataMap1.put("color", "#173177");
        d.put("storeName", dataMap1);

        Map<Object,Object> dataMap2 = new HashMap<Object, Object>();
        dataMap2.put("value", orderId);
        dataMap2.put("color", "#173177");
        d.put("orderId", dataMap2);

        Map<Object,Object> dataMap3 = new HashMap<Object, Object>();
        dataMap3.put("value", "堂食");
        dataMap3.put("color", "#173177");
        d.put("orderType", dataMap3);


        map.put("data", d);
        return map;
    }

    public static Map<Object,Object> orderPayMsg(String openid,String payTotal,String datetime){
        Map<Object,Object> map = new HashMap<Object, Object>();
        map.put("touser", openid);
        //map.put("template_id", "nnGDu2hnFqO3tw5BbNhja1dC87ZlkdHkkoX6DH-rEZ8");
        map.put("template_id", "FdlHczcM-kZ1D3t9xtu7QhXenFRSuOcKLPJ6OT5KoKE");
        String ddUrl= WxConstant.WX_DOMAIN+"wechat/index.html?from=orders#action=orders";
        map.put("url", ddUrl);
        map.put("topcolor", "#FFFFFF");

        Map<Object,Object> d = new HashMap<Object, Object>();

        Map<Object,Object> dataMap1 = new HashMap<Object, Object>();
        dataMap1.put("value", payTotal);
        dataMap1.put("color", "#173177");
        d.put("pay", dataMap1);

        Map<Object,Object> dataMap2 = new HashMap<Object, Object>();
        dataMap2.put("value", "智慧餐饮点餐");
        dataMap2.put("color", "#173177");
        d.put("address", dataMap2);

        Map<Object,Object> dataMap3 = new HashMap<Object, Object>();
        dataMap3.put("value", datetime);
        dataMap3.put("color", "#173177");
        d.put("time", dataMap3);

        Map<Object,Object> dataMap4 = new HashMap<Object, Object>();
        dataMap4.put("value", "如有疑问，请联系服务员");
        dataMap4.put("color", "#173177");
        d.put("remark", dataMap4);


        map.put("data", d);
        return map;
    }
}
